﻿namespace UnityEngine
{
    using System;
    using System.Reflection;

    [NotRenamed]
    internal static class ScriptingMethodHelper
    {
        [NotRenamed]
        internal static MethodInfo GetMethodInfo(System.Type type, string methodName)
        {
            return type.GetMethod(methodName);
        }

        [NotRenamed]
        internal static System.Type NthArgumentType(MethodInfo methodInfo, int index)
        {
            ParameterInfo[] parameters = methodInfo.GetParameters();
            if (parameters.Length <= index)
            {
                return null;
            }
            return parameters[index].ParameterType;
        }

        [NotRenamed]
        internal static int NumberOfArgumentsOf(MethodInfo methodInfo)
        {
            return methodInfo.GetParameters().Length;
        }
    }
}

